<%--
  Created by IntelliJ IDEA.
  User: v.tsapaev
  Date: 26.05.12
  Time: 0:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<a href="cart.htm">Корзина</a>
<table class="table-center">
    <c:set var="totalSum" value="${0}" />
    <c:set var="totalCount" value="${0}" />
    <c:forEach var="book" items="${sessionScope.order.bookMap}">
        <c:set var="totalSum" value="${totalSum + book.key.price * book.value}" />
        <c:set var="totalCount" value="${totalCount + book.value}" />
    </c:forEach>
    <tr>
        <td><div>Всего товаров:</div></td>
        <td><div class="number">${totalCount}</div></td>
    </tr>
    <tr>
        <td><div>На сумму:</div></td>
        <td><div class="number">${totalSum}</div></td>
    </tr>
</table>
